-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(i18n): convert reference input strings to use i18n primitives #4977
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid! Left a few questions/comments but only minor stuff.
@@ -2,7 +2,7 @@ import React, {ComponentProps, ForwardedRef, forwardRef, useCallback, useMemo, u | |||
import {from, throwError} from 'rxjs' | |||
import {catchError, mergeMap} from 'rxjs/operators' | |||
import * as PathUtils from '@sanity/util/paths' | |||
import { | |||
import type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on an completely unrelated note, we might want to add an eslint rule to enforce this consistently throughout the codebase
@@ -82,7 +82,7 @@ describe('simpleParser - errors', () => { | |||
}) | |||
test('unclosed tags', () => { | |||
expect(() => simpleParser('foo <Icon> bar')).toThrow( | |||
'No matching closing tag for <Icon> found. Either make it self closing (e.g. "<Icon/>") or close it (e.g "<Icon>...</Icon>")', | |||
'No matching closing tag for <Icon> found. Either make it self closing (e.g. "<Icon/>") or close it (e.g "<Icon>...</Icon>").', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appreciate your attention to detail here :)
* @param options - Optional options for the list formatter | ||
* @returns Instance of `Intl.ListFormat` | ||
*/ | ||
export function useIntlListFormat(options?: UseIntlListFormatOptions): Intl.ListFormat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great <3
Full Reportsanity
@sanity/types
sanity/desk
@sanity/diff
@sanity/block-tools
@sanity/portable-text-editor
@sanity/mutator
@sanity/cli
@sanity/schema/_internal
@sanity/util/paths
sanity/router
@sanity/util/legacyDateFormat
@sanity/schema
sanity/cli
@sanity/vision
@sanity/util/fs
sanity/_internal
@sanity/util/content
|
Component Testing Report Updated Oct 11, 2023 8:08 PM (UTC)
|
b66d126
to
0063c84
Compare
Makes it easier to get hold of a list formatter outside of locale resources, which you sometimes need, while ensuring it is using the correct (current) locale, and does not recreate the formatter on every render.
0063c84
to
3198bad
Compare
Notes
components
required for<Translate />
component in order to discourage using it outside of cases where you actually need it<Translate>
component<TimeAgo />
) is broken - we knew this, but should probably be addressed soon in another PR. Some strings are coming from date-fns currently, while others are localized.